home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1998 July / MacFormat CD-ROM MF65 (Future Publishing, Ltd.)(July 1998).iso / Shareware Plus / Utilities / Jot-A-Lot 1.0 / About Link GURL Handler… < prev    next >
Encoding:
Text File  |  1998-03-28  |  5.8 KB  |  84 lines  |  [TEXT/ttxt]

  1.  
  2.                     Link GURL Handler
  3.  
  4.                                                  freeware by Niklas Frykholm
  5.  
  6.  
  7.  
  8. The Link GURL Handler is a program intended to be used together with Internet Config. It allows you to link together documents and applications using the same syntax as the URL-links found on home pages.
  9.  
  10.  
  11. What it is
  12.  
  13. The Link GURL Handler allows you to link documents with applications, folders and other documents on your hard drive so that you can launch one document by simply clicking on some text in another. It does this by extending the concept of links on the Internet to files on your hard drive.
  14.  
  15. An Internet address (an URL) tells your computer where on the Internet it can find a certain document. It might look something like this
  16.  
  17.     http://www.acc.umu.se/~r2d2/
  18.  
  19. Programs on the Macintosh computer communicate by sending AppleEvents to each other. If one program wants to tell another program to go and find a document which is located at a certain URL it sends a so called GURL-event (get URL). The other program responds to this event by fetching the appropriate document.
  20.  
  21. The Link GURL Handler handles a special kind of GURL-events, called link-URLs. A link-URL might look like this
  22.  
  23.     link:/HD/Documents/My+file
  24.  
  25. When the Link GURL handler receives this event it opens the document "My file" in the folder "Documents" on the volume "HD". By sending URLs of this kind to the program you can tell it to open any file and launch any program on your hard drive.
  26.  
  27.  
  28. Internet Config
  29.  
  30. To be able to handle these events, the Link GURL Handler must first be able to get them, i. e. someone must send these events to the Link GURL Handler. This is where Internet Config comes into the picture. Internet Config is a general tool for associating Handlers with different types of GURL events. Using Internet Config you can specify which program will handle which URL-event. For example you may specify that "http"-events (ordinary web pages) should be handled by "Netscape" and "ftp"-events (file transfers) by Fetch.
  31.  
  32. If a program wants to open an URL, any kind of URL, all it has to do is ask Internet Config to open the URL. Internet Config will look at the URL and determine which program that should handle the GURL-event. The event will then be dispatched to this program.
  33.  
  34.  
  35. Setting up Internet Config
  36.  
  37. For file linking to work properly, you must tell Internet Config that the "link"-type URLs should be handled by the Link GURL Handler. This is not hard to do. Make sure that Internet Config is installed on your system (it can be found on all major shareware sites). Start the Internet Config application and click on the icon labeled "Helpers". A window will pop up that displays the programs that handle all the different kinds of URLs.
  38.  
  39. Click on the "Add" button in that window to add a new handler. Write "link" in the text field labeled "Helper for:". Then click on the "Choose Helper" button and use the standard file dialog box to locate the Link GURL Handler. Now the Link GURL Handler has been designated to handle "link"-URLs and each time an URL such as
  40.  
  41.     link:/HD/Documents/My+file
  42.  
  43. is clicked, the corresponding document will be opened.
  44.  
  45.  
  46. URL Encoding
  47.  
  48. Some programs (such as Jot-A-Lot) will create "link"-URLs automatically for you. All you have to do is specify the file using the standard file dialog box and a link to that file will appear. Other programs, however, lack this facility, so you may have to type the URLs in manually. To do that you must know the URL syntax.
  49.  
  50. There are two types of URLs - absolute URLs and relative URLs. An absolute URL begins with a slash / and specifies the entire search path to the document, starting with the volume name. Each folder name is separated by a slash, as in the following example
  51.  
  52.     link:/HD/Folder/Subfolder/File
  53.  
  54. The URL must be a single unbroken string, so it may not contain any spaces. Spaces in the names of folders and files are therefore replaced by "+"-signs in the URL. We say that the spaces have been encoded. When the URL is interpreted the "+"-signs are decoded back to spaces so that the appropriate file can be found
  55.  
  56.     link:/Hard+Disc/A+Folder/A+Subfolder/The+File
  57.  
  58. A second kind of encoding is also needed, because, as we have seen the characters "+" and "/" have special meanings in the URL. If we had a file on our hard disc had a "+" in its name, we could not simply write the "+" in the URL since it would be converted to a space when the URL was decoded. Thus we must encode "+"s and "/"s in some way. These characters are encoded as a "%"-sign followed by the hexadecimal ascii-value of the character. For example "+" has the ascii-value 2B and "/" has the ascii-value 2F. We must also encode "%" since it has been given a new meaning. "%" has the ascii-value 25. (PopChar is a useful shareware tool for finding ascii-values).
  59.  
  60.     link:/Hard+Disc/Wins+%2B+Losses/50%25+Earnings/Deal+5%2F7+97
  61.  
  62. If the file containing the link is located on another computer than a Macintosh, you should also encode all national characters (such as å, ä, and ö) since these are represented differently on different computers. If the file is located on a Macintosh you do not need to encode these characters.
  63.  
  64. A relative link does not begin with a "/". It specifies the search path relative to the location of the Link GURL Handler. For example
  65.  
  66.     link:Eudora
  67.  
  68. will open the file named "Eudora" that is located in the same directory as the Link GURL Handler. A useful trick is to put aliases to programs that you use often in the directory of the Link GURL Handler. You can then create links to them in the simple way shown above.
  69.  
  70.  
  71. About the author
  72.  
  73. The Link GURL Handler was written by Niklas Frykholm. Snail mail reaches me at
  74.  
  75.     Niklas Frykholm
  76.     Rothoffsv. 37 A
  77.     903 31 Umeå
  78.     Sweden
  79.  
  80. In cyberspace I'm found at
  81.  
  82.     http://www.acc.umu.se/~r2d2/
  83.     mailto:niklasf@cs.umu.se
  84.